Skip to content

add task solution fix#1549

Open
yana-longstocking wants to merge 2 commits into
mate-academy:masterfrom
yana-longstocking:develop
Open

add task solution fix#1549
yana-longstocking wants to merge 2 commits into
mate-academy:masterfrom
yana-longstocking:develop

Conversation

@yana-longstocking

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Your implementation is missing required handlers. The task explicitly states 'add success and error handlers for both promises', meaning each promise needs both a .then() handler AND a .catch() handler. Currently, promise1 only has .then() and is missing .catch(), while promise2 only has .catch() and is missing .then(). To fix this:

  1. Add a .catch() handler to promise1 that calls showMessage(false)
  2. Add a .then() handler to promise2 that calls showMessage(true)

The .then() handler for promise2 would never execute in the current flow (since the promise rejects before user click), but it's still required per the specification and can simply log to the console or call showMessage(true).


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/scripts/main.js
document.body.appendChild(div);
}

promise1.then(() => showMessage('Promise was resolved!'));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing error handler for promise1. The requirement states 'add success and error handlers for both promises', so promise1 also needs a .catch() handler.

Comment thread src/scripts/main.js
}

promise1.then(() => showMessage('Promise was resolved!'));
promise2.catch(() => showMessage('Promise was rejected!', true));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing success handler for promise2. The requirement states 'add success and error handlers for both promises', so promise2 also needs a .then() handler.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Your implementation correctly fulfills all the requirements specified in the task. Both promise1 and promise2 are properly set up with both success and error handlers, the click event listener on .logo correctly resolves promise1, and the 3-second timeout correctly rejects promise2. The message display logic correctly differentiates between success and error states by applying the appropriate classes and text content. All checklist items pass, and there are no critical issues or blockers that need to be addressed.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants